home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / bumpcopter2.swf / scripts / frame_53 / PlaceObject2_538_1100 / CLIPACTIONRECORD onClipEvent(enterFrame).as < prev    next >
Encoding:
Text File  |  2006-06-13  |  672 b   |  44 lines

  1. onClipEvent(enterFrame){
  2.    if(_X >= _root.copter._x)
  3.    {
  4.       xS++;
  5.    }
  6.    if(_X <= _root.copter._x)
  7.    {
  8.       xS--;
  9.    }
  10.    if(_Y >= _root.copter._y)
  11.    {
  12.       yS++;
  13.    }
  14.    if(_Y <= _root.copter._y)
  15.    {
  16.       yS--;
  17.    }
  18.    if(yS >= yMax)
  19.    {
  20.       yS = yMax;
  21.    }
  22.    if(xS >= xMax)
  23.    {
  24.       xS = xMax;
  25.    }
  26.    if(yS <= yMin)
  27.    {
  28.       yS = yMin;
  29.    }
  30.    if(xS <= xMin)
  31.    {
  32.       xS = xMin;
  33.    }
  34.    if(this.hit.hitTest(_root.copter))
  35.    {
  36.       this.gotoAndStop(2);
  37.    }
  38.    _X = _X - xS;
  39.    _Y = _Y - yS;
  40.    _rotation = 57.3 * Math.atan2(_root.copter._y - _Y,_root.copter._x - _X);
  41.    time -= 0.5;
  42.    trace(time);
  43. }
  44.